package org.custom.spring.boot.useless;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;
import java.util.List;

/**
 * 用于spring-boot-cache测试的Menu实体类
 *
 * @author LiKun
 * @date 2021/7/29 0:34
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
@TableName("menu")
@ApiModel("菜单相关实体类")
public class Menu implements Serializable {
    private static final long serialVersionUID = -411264840432434204L;
    @TableId
    @ApiModelProperty(name = "id", notes = "主键ID")
    private String id;
    @ApiModelProperty(name = "seq", notes = "菜单排序")
    private int seq;
    @ApiModelProperty(name = "name", notes = "菜单名称")
    private String name;
    @ApiModelProperty(name = "url", notes = "菜单访问地址")
    private String url;
    @ApiModelProperty(name = "icon", notes = "菜单展示图标")
    private String icon;
    @ApiModelProperty(name = "enable", notes = "菜单是否可用")
    private boolean enable;
    @ApiModelProperty(name = "parentId", notes = "父级菜单ID")
    private String parentId;
    @ApiModelProperty(name = "authority", notes = "菜单访问权限")
    private String authority;
    @TableField(exist = false)
    @ApiModelProperty(name = "menus", notes = "子级菜单")
    private List<Menu> menus;

    public Menu setMenus(List<Menu> menus) {
        this.menus = menus;
        return this;
    }
}
